package cn.gx.kevin.domain;

import org.apache.ibatis.session.SqlSession;

import java.util.LinkedList;

/***
 *@description : 动态dao where条件的参数基类
 *@author : kevin.huang
 *@date : 2019/10/28 10:59
 @modified by
 ***/
public class DynamicBaseWhereParam extends DynamicBaseParam{
    /*****动态条件值*****/
    LinkedList<DynamicWhereParam> whereValues = new  LinkedList<DynamicWhereParam>();

    /*****动态条件值*****/
    public LinkedList<DynamicWhereParam> getWhereValues() {
        return whereValues;
    }

    /*****动态条件值*****/
    public void setWhereValues(LinkedList<DynamicWhereParam> whereValues) {
        for(DynamicWhereParam where : whereValues){
           String fielName = this.replaceIllegalChars( where.getFieldName());
           Object fielValue = where.getFieldValue();
           if(fielValue != null && fielValue instanceof  String){
               fielValue = this.replaceIllegalChars(String.valueOf(fielValue));
           }
           where.setFieldName(fielName);
           where.setFieldValue(fielValue);
        }
        this.whereValues = whereValues;
    }

    public SqlSession getSqlSession() {
        return sqlSession;
    }

    public void setSqlSession(SqlSession sqlSession) {
        this.sqlSession = sqlSession;
    }

    SqlSession sqlSession = null;


}
